<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\TestBean;

class TestValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 TestBean::$id => 'require', //
			 TestBean::$name => 'require|max:255', //
		];
		$this->message = [
			TestBean::$id.POINST."require " => 'id必须', //
			TestBean::$name.POINST."require " => 'name必须', //
		];
		$this->scene = [
			self::$all => [
				TestBean::$id,
				TestBean::$name,
			],
			self::$add => [
				TestBean::$name,
			],
			self::$edit => [
				TestBean::$id,
				TestBean::$name,
			],
			self::$pkId => [],

		];
	}


}
